<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>充值列表管理</title>
    <#include "/include/resource.html"/>
    <style>
    </style>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
    <#include "/include/header.html"/>
    <!-- Left side column. contains the logo and sidebar -->
    <#include "/include/main-sidebar.html"/>
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                会员列表
                <small>充值记录</small>
            </h1>
            <ol class="breadcrumb">
                <li><i class="fa fa-dashboard"></i> 会员列表</li>
                <li class="active">会员信息列表</li>
            </ol>
        </section>

        <!-- Main content -->
        <form id="tableForm" method="post" class="form-horizontal" action="${base}/admin/rider/list">
            <section class="content queryForm">
                <div class="row">
                    <div class="col-md-12">
                        <div class="box">

                            <!-- /.box-header -->
                            <div class="box-body">
                                <div class="form-group">
                                    <div class="row">
                                        <div class="col-md-2">
                                            <label for="inputEmail3_" class="col-md-4 control-label">Name</label>
                                            <div class="col-md-8">
                                                <input type="text" class="form-control" value="${(riderName)!''}"
                                                       name="riderName" id="inputEmail3_" placeholder="Name">
                                            </div>
                                        </div>
                                        <div class="col-md-2">
                                            <label for="inputEmail3_" class="col-md-4 control-label">电话</label>
                                            <div class="col-md-8">
                                                <input type="text" class="form-control" value="${(phone)!''}"
                                                       name="phone" id="inputEmail4_" placeholder="电话号码">
                                            </div>
                                        </div>
                                        <div class="col-md-3">
                                            <label for="inputEmail3_" class="col-md-4 control-label">充值时间段：</label>
                                            <div class="col-md-8 input-daterange input-group" id="datepicker">
                                                <input type="text" class="form-control input-sm" value="${(beginDate)!''}"
                                                       name="beginDate">
                                                <span class="input-group-addon">至</span>
                                                <input type="text" class="form-control input-sm" value="${(endDate)!''}"
                                                       name="endDate">
                                            </div>
                                        </div>
                                        <div class="col-md-1">
                                            <span>
                                            <button type="button" onclick="HF.listQuery();"
                                                    class="btn btn-primary">Query
                                            </button>
                                            <button style="float: right;" type="button" onclick="HF.listExcelExport();"
                                                    class="btn btn-primary">导出
                                            </button>
                                                </span>
                                        </div>
                                    </div>
                                </div>
                                <table class="table table-bordered">
                                    <tr>
                                        <th>SequenceNo</th>
                                        <th>骑手Name</th>
                                        <th>手机号</th>
                                        <th>缴费类型</th>
                                        <th>金额</th>
                                        <th>Note1</th>
                                        <th>Note2</th>
                                        <th>日期</th>

                                    </tr>
                                    <#if list??&&list?size gt 0>
                                    <#list list as t>
                                    <tr>
                                        <td>${t_index+1}</td>
                                        <td>${(t.riderName)!""}</td>
                                        <td>${(t.phone)!""}</td>
                                        <td>${(t.catagory)!""}</td>
                                        <td>${(t.payMoney)!""}</td>
                                        <td>${(t.packageName)!""}</td>
                                        <td><input name="memo" value='${(t.memo)!""}' onblur="saveMemo(this,'${t.id}')"></td>
                                        <td>${nav.getDate((t.createDate)!0)}</td>

                                    </tr>
                                </#list>
                                <#else>
                                <td colspan="11" align="center">no record!</td>
                            </#if>
                            </table>

                            </div>
                            <!-- /.box-body -->
                            <@p.pager pageNo=pageNo pageSize=pageSize totalCount=totalCount />
                        </div>
                        <!-- /.box -->
                    </div>
                </div>
            </section>
        </form>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
    <#include "/include/modal.html"/>
    <#include "/include/footer.html"/>
    <div class="control-sidebar-bg"></div>
</div>
<#include "/include/js_footer.html"/>
</body>
</html>
<script>
    $(function(){
        $.fn.datepicker.defaults.format = "yyyy-mm-dd";
        $('#datepicker').datepicker({
            autoclose: true
        })
    })
    function saveMemo(obj,id) {
        $.ajax({
            type: "POST",
            url: "/admin/rider/savePayLogMemo",
            data:{
                memo:obj.value,
                id:id
            },
            dataType: "json",
            success: function(data){
                alert("设置 Success");
                // document.location.reload();
            },
            error:function(){
                alert("系统未知异常!");
            }
        });
    }
    function setState(state,id) {
        $.ajax({
            type: "GET",
            url: "/admin/rider/setState?id="+id+"&state="+state,
            dataType: "json",
            success: function(data){
                alert("设置 Success");
                document.location.reload();
            },
            error:function(){
                alert("系统未知异常!");
            }
        });
    }
</script>
